{"componentChunkName":"component---src-templates-post-tsx","path":"/npm/","result":{"data":{"markdownRemark":{"html":"<ul>\n<li>npm install --save-prod? npm install --save-dev?</li>\n<li>npm install 와 npm install -g의 차이</li>\n</ul>\n<hr>\n<h2 id=\"npm-install---save-prod-npm-install---save-dev\" style=\"position:relative;\"><a href=\"#npm-install---save-prod-npm-install---save-dev\" aria-label=\"npm install   save prod npm install   save dev permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>npm install --save-prod? npm install --save-dev?</h2>\n<h3 id=\"1--p---save-prod-플래그-사용\" style=\"position:relative;\"><a href=\"#1--p---save-prod-%ED%94%8C%EB%9E%98%EA%B7%B8-%EC%82%AC%EC%9A%A9\" aria-label=\"1  p   save prod 플래그 사용 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. -P, --save-prod 플래그 사용</h3>\n<ul>\n<li>패키지를 설치하고 프로젝트의 <code class=\"language-text\">dependencies</code> 목록에 추가한다.</li>\n<li>하지만 npm5부터는 이 플래그를 사용하지 않아도 dependecies에 항목을 추가할 수 있다.</li>\n</ul>\n<h3 id=\"2--d-save-dev-플래그-사용\" style=\"position:relative;\"><a href=\"#2--d-save-dev-%ED%94%8C%EB%9E%98%EA%B7%B8-%EC%82%AC%EC%9A%A9\" aria-label=\"2  d save dev 플래그 사용 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. -D, —save-dev 플래그 사용</h3>\n<ul>\n<li>패키지를 설치하고 프로젝트의 <code class=\"language-text\">devDependencies</code> 목록에 추가한다.</li>\n</ul>\n<h3 id=\"3-dependencies-와-devdependencies\" style=\"position:relative;\"><a href=\"#3-dependencies-%EC%99%80-devdependencies\" aria-label=\"3 dependencies 와 devdependencies permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. dependencies 와 devDependencies</h3>\n<ul>\n<li><code class=\"language-text\">dependencies</code> : express 패키지 처럼 실제 코드도 포함되며 앱 구동을 위해 필요한 의존성 파일들</li>\n<li><code class=\"language-text\">devDependencies</code> : concurrently 패키지처럼 실제 코드에 포함되지 않으며 개발 단계에만 필요한 의존성 파일들</li>\n</ul>\n<h3 id=\"4-굳이-사용하는-이유가-뭘까\" style=\"position:relative;\"><a href=\"#4-%EA%B5%B3%EC%9D%B4-%EC%82%AC%EC%9A%A9%ED%95%98%EB%8A%94-%EC%9D%B4%EC%9C%A0%EA%B0%80-%EB%AD%98%EA%B9%8C\" aria-label=\"4 굳이 사용하는 이유가 뭘까 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. 굳이 사용하는 이유가 뭘까?</h3>\n<p>플래그를 사용해 dependencies 와 devDependencies 로 의존성 목록을 구분하면 “이건 개발용, 이건 실제 서비스용” 으로 구분하기 쉬워진다는 면에서 개발자들에게 필요한 기능이라고 볼 수 있다.</p>\n<hr>\n<h2 id=\"npm-install-와-npm-install--g-의-차이\" style=\"position:relative;\"><a href=\"#npm-install-%EC%99%80-npm-install--g-%EC%9D%98-%EC%B0%A8%EC%9D%B4\" aria-label=\"npm install 와 npm install  g 의 차이 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>npm install 와 npm install -g 의 차이</h2>\n<ul>\n<li><code class=\"language-text\">npm install (패키지명)</code> : 프로젝트 폴더에 패키지 설치</li>\n<li><code class=\"language-text\">npm install -g (패키지명)</code> : 시스템 폴더에 패키지 설치\n(win10 기준으로는 <code class=\"language-text\">(사용자명)\\AppData\\Roaming\\npm\\node_modules</code> )\n시스템의 node_modules 폴더 경로는 <code class=\"language-text\">npm root -g</code> 를 통해 찾을 수 있다.</li>\n</ul>\n<hr>\n<h4 id=\"reference\" style=\"position:relative;\"><a href=\"#reference\" aria-label=\"reference permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Reference</h4>\n<ul>\n<li><a href=\"https://ko.javascript.info/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://ko.javascript.info/</a></li>\n</ul>","excerpt":"npm install --save-prod? npm install --save-dev? npm install 와 npm install -g의 차이 npm install --save-prod? npm install --save-dev? 1. -P, -…","tableOfContents":"<ul>\n<li>\n<p><a href=\"/npm/#npm-install---save-prod-npm-install---save-dev\">npm install --save-prod? npm install --save-dev?</a></p>\n<ul>\n<li><a href=\"/npm/#1--p---save-prod-%ED%94%8C%EB%9E%98%EA%B7%B8-%EC%82%AC%EC%9A%A9\">1. -P, --save-prod 플래그 사용</a></li>\n<li><a href=\"/npm/#2--d-save-dev-%ED%94%8C%EB%9E%98%EA%B7%B8-%EC%82%AC%EC%9A%A9\">2. -D, —save-dev 플래그 사용</a></li>\n<li><a href=\"/npm/#3-dependencies-%EC%99%80-devdependencies\">3. dependencies 와 devDependencies</a></li>\n<li><a href=\"/npm/#4-%EA%B5%B3%EC%9D%B4-%EC%82%AC%EC%9A%A9%ED%95%98%EB%8A%94-%EC%9D%B4%EC%9C%A0%EA%B0%80-%EB%AD%98%EA%B9%8C\">4. 굳이 사용하는 이유가 뭘까?</a></li>\n</ul>\n</li>\n<li><a href=\"/npm/#npm-install-%EC%99%80-npm-install--g-%EC%9D%98-%EC%B0%A8%EC%9D%B4\">npm install 와 npm install -g 의 차이</a></li>\n</ul>","fields":{"slug":"/npm/"},"frontmatter":{"title":"npm","date":"Jun 05, 2019","tags":["Node.js","npm"],"keywords":["npm"],"update":"Jan 01, 0001"}}},"pageContext":{"slug":"/npm/","series":[],"lastmod":"2019-06-05"}},"staticQueryHashes":["2027115977","694178885"]}